CC := g++
CFLAGS := -Wall
LFLAGS :=  -lm -lpthread -lX11
CCX := $(shell wx-config --cxx)

# wx-config --libs
WX_LIBS := $(shell wx-config --libs)
# wx-config --cxxflags
WX_CCXFLAGS := $(shell wx-config --cxxflags)


all : GUI forward backward

GUI : GUI.o
	$(CCX) $(WX_LIBS) -o $@ $^

GUI.o : GUI.cpp
	$(CCX) $(WX_CCXFLAGS) -c -o $@ $<

forward : forward.o functions.o 
		$(CC)  $(CFLAGS) $^ -o $@ $(LFLAGS) 

forward.o : forward.cpp
		$(CC) $(CFLAGS) -c -o $@ $^ $(LFLAGS) 

backward : backward.o functions.o 
		$(CC)  $(CFLAGS) $^ -o $@ $(LFLAGS) 

backward.o : backward.cpp
		$(CC) $(CFLAGS) -c -o $@ $^ $(LFLAGS) 

functions.o : functions.cpp
		$(CC) $(CFLAGS) -c -o $@ $^ $(LFLAGS) 


clean :
	-rm -f *.o *~ GUI  backward forward
